package com.example.backend.service;

import com.example.backend.model.UserAuth;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

@Service
public class UserAuthService implements com.example.backend.mapper.UserAuthService {

    // 模拟用户数据库
    private static final Map<String, String> users = new HashMap<>();

    static {
        users.put("admin", "admin123");
    }

    @Override
    public boolean authenticate(UserAuth userAuth) {
        String storedPassword = users.get(userAuth.getUsername());
        return storedPassword != null && storedPassword.equals(userAuth.getPassword());
    }
}